package notifier

import (
	"github.com/blinkbean/dingtalk"
)

func NewPrometheusDingTalk(token, secret string, atMobiles []string) *DingTalk {
	return &DingTalk{
		Token:     token,
		Secret:    secret,
		AtMobiles: atMobiles,
	}
}

func (d *DingTalk) SendMarkdownMsg(title, content string) error {
	cli := dingtalk.InitDingTalkWithSecret(d.Token, d.Secret)
	err := cli.SendMarkDownMessage(title, content, dingtalk.WithAtMobiles(d.AtMobiles))

	return err
}
